#!/bin/bash
# author(only .sh): saiumr

if [ ${1:0-2:2} == ".c" ] 
then
    gcc -o "${1%.*}.out" $1 glad.c -lglfw3 -lGL -lX11 -lpthread -lXrandr -lXxf86vm -lXinerama -lXcursor -lXi -ldl -lm

elif [ ${1:0-4:4} == ".cpp" ]
then
    g++ -o "${1%.*}.out" $1 glad.c -lglfw3 -lGL -lX11 -lpthread -lXrandr -lXxf86vm -lXinerama -lXcursor -lXi -ldl

else
    echo 'Filename Error'

fi